<?php
/**
 * Created by PhpStorm.
 * User: Dave
 * Date: 2018/4/11
 * Time: 18:38
 */

use Biz\service\ShopSpecial as sShopSpecial;
use Biz\tools\GoodsExposureLog;

/**
 * @deprecated
 */
class SpecialAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    public function main()
    {

        $specialId = $this->getRequest()->getQuery('special_id', 0);
        if (!$specialId) {
            throw new \Exception('ID不能为空');
        }
        $provinceId = $this->getRequest()->getQuery('province_id');
        $cityId = $this->getRequest()->getQuery('city_id');
        $areaCode = $cityId ? $cityId : $provinceId;
        $specianInfo = sShopSpecial::getSpecialInfo($specialId, $areaCode);
        $this->setSuccess($specianInfo);
        GoodsExposureLog::addLog($this->getRequest(), $specianInfo, $specialId);
    }
}